package com.jdk8.demo;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class Java8_Stream_Max {
	
	public static void main(String[] args) throws IOException {

		//找出最长一行的长度
		BufferedReader br = new BufferedReader(new FileReader("/home/jyh/文档/test"));
		int longest = br.lines().
		 mapToInt(String::length).
		 max().
		 getAsInt();
		br.close();
		System.out.println(longest);
		
		
	}

}
